package com.rran.study.designpattern.behavioral.state;

/**
 * @author yy
 * @Type GoodMorning.java
 * @Desc 早晨状态 状态的一个分支
 * @date 2020/7/27 19:02
 */
public class GoodMorning implements State{

    @Override
    public void WriteProgram(Work work) {
        if (work.getHour() < 12) {
            System.out.println("工作状态很好啊");
        } else {
            work.setState(new AfterMorning());
            work.writeProgram();
        }

    }
}